package com.tobeface.sns.infrastructure.persist.blog.impl;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.stereotype.Repository;

import com.kissme.core.orm.Page;
import com.tobeface.sns.domain.blog.BlogChannel;
import com.tobeface.sns.infrastructure.persist.CrudMongoRepositorySupport;
import com.tobeface.sns.infrastructure.persist.blog.BlogChannelRepository;

/**
 * @author Linxiaosheng
 */
@Repository
public class BlogChannelRepositoryImpl extends CrudMongoRepositorySupport<BlogChannel, String> implements BlogChannelRepository {

	@Autowired
	protected BlogChannelRepositoryImpl(MongoOperations mongoOperations) {
		super(mongoOperations);
	}

	@Override
	public BlogChannel save(BlogChannel blogChannel) {
		return super.save(blogChannel); 
	}

	@Override
	public BlogChannel findOne(String id) {
		return super.findOne(id);
	}

	@Override
	public Page<BlogChannel> findPage(Page<BlogChannel> page) {
		return super.findPage(page);
	}
	
	@Override
	public Collection<BlogChannel> findAll() {
		return super.getMongoOperations().findAll(BlogChannel.class, "blogChannel");
		
	}
}
